PYTHON-XXXX Reject extra fields in Extended JSON timestamps#2961
Open
winklemad wants to merge 1 commit into
Open
PYTHON-XXXX Reject extra fields in Extended JSON timestamps#2961winklemad wants to merge 1 commit into
winklemad wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PYTHON-XXXX
Changes in this PR
bson.json_util.loadsnow rejects$timestampvalue documents that contain anything other than the requiredtandicomponents. Previously, unexpected fields could be silently discarded while constructingbson.timestamp.Timestamp.This adds regressions for both additional fields and same-length invalid key sets, and updates the changelog and contributor list.
AI assistance disclosure: I used OpenAI Codex to help investigate the existing behavior, search for duplicates, implement the change, and run validation. I reviewed and understand every changed line and can explain and maintain the contribution.
Test Plan
python3 -m unittest test.test_json_util.TestJsonUtil.test_timestamp test.test_json_util.TestJsonUtil.test_timestamp_with_invalid_fieldspython3 -m unittest test.test_json_util test.test_bson_corpusruff check bson/json_util.py test/test_json_util.pyruff format --check bson/json_util.py test/test_json_util.pypython3 -m compileall -q bson/json_util.py test/test_json_util.pygit diff --checkAll listed checks passed.
Checklist
Checklist for Author
No follow-up work is currently identified. As an external contributor without an existing JIRA ticket, I retained the template
PYTHON-XXXXplaceholder for a MongoDB employee to update.Checklist for Reviewer